package net.message
{

	import flash.utils.IDataInput;

	import net.MessageType;
	import net.data.HeroInfo;
	import net.handler.GC_Loading_HeroHandler;

	import util.Long;

	/**
	 * 文件名：GC_Loading_HeroMessage.as
	 * <p>
	 * 功能：读取英雄列表
	 * <p>
	 * 版本：1.0.0
	 * <p>
	 * 作者：Builderd by AppTools
	 * <p>
	 */
	public class GC_Loading_HeroMessage extends BaseMessage
	{
		public var dataProvider:Vector.<HeroInfo>;

		public function GC_Loading_HeroMessage()
		{
			super();
			type = MessageType.GC_Loading_Hero;
			handler = new GC_Loading_HeroHandler();
		}

		override public function readMessage(data:IDataInput):void
		{
			dataProvider = new Vector.<HeroInfo>;
			//写入list长度
			var size:int = data.readByte();

			for(var i:int = 0; i < size; i++)
			{
				var itemInfo:HeroInfo = new HeroInfo();

				//写入装备key-主键
				itemInfo.heroId = Long.read(data);
				//写入英雄模板Code
				itemInfo.heroCode = data.readInt();
				//写入智力-洗属性
				itemInfo.wisdomAppend = data.readInt();
				//写入力量-洗属性
				itemInfo.strengthAppend = data.readInt();
				//写入幸运-洗属性
				itemInfo.luckyAppend = data.readInt();
				//写入智力-洗属性-待确认
				itemInfo.wisdomAppend1 = data.readInt();
				//写入力量-洗属性-待确认
				itemInfo.strengthAppend1 = data.readInt();
				//写入幸运-洗属性-待确认
				itemInfo.luckyAppend1 = data.readInt();
				//写入级别
				itemInfo.level = data.readInt();
				//写入经验
				itemInfo.experience = data.readInt();

				dataProvider.push(itemInfo);
			}
		}
	}
}
